﻿using System;
using System.ComponentModel;
using System.Windows;

namespace HalconDotNet
{
	// Token: 0x02000016 RID: 22
	public class HMessageDisplayObjectWPF : HDisplayObjectWPF
	{
		// Token: 0x060000F8 RID: 248 RVA: 0x00005EBF File Offset: 0x000040BF
		public HMessageDisplayObjectWPF(HTuple msg)
		{
			this.HMessageText = msg;
		}

		// Token: 0x060000F9 RID: 249 RVA: 0x00005EF3 File Offset: 0x000040F3
		public HMessageDisplayObjectWPF()
		{
		}

		// Token: 0x060000FA RID: 250 RVA: 0x00005F1B File Offset: 0x0000411B
		protected override void Dispose(bool disposing)
		{
			if (!this.disposed)
			{
				this.disposed = true;
			}
		}

		// Token: 0x1700002F RID: 47
		// (get) Token: 0x060000FB RID: 251 RVA: 0x00005F2E File Offset: 0x0000412E
		// (set) Token: 0x060000FC RID: 252 RVA: 0x00005F40 File Offset: 0x00004140
		[Category("Appearance")]
		[EditorBrowsable(EditorBrowsableState.Always)]
		[Description("Font of the displayes message.")]
		public string HFont
		{
			get
			{
				return (string)base.GetValue(HMessageDisplayObjectWPF.HFontProperty);
			}
			set
			{
				base.SetValue(HMessageDisplayObjectWPF.HFontProperty, value);
			}
		}

		// Token: 0x17000030 RID: 48
		// (get) Token: 0x060000FD RID: 253 RVA: 0x00005F4E File Offset: 0x0000414E
		// (set) Token: 0x060000FE RID: 254 RVA: 0x00005F60 File Offset: 0x00004160
		[Category("Appearance")]
		[EditorBrowsable(EditorBrowsableState.Always)]
		[Description("Text to display in the message.")]
		public string HMessageText
		{
			get
			{
				return (string)base.GetValue(HMessageDisplayObjectWPF.MessageTextProperty);
			}
			set
			{
				base.SetValue(HMessageDisplayObjectWPF.MessageTextProperty, value);
			}
		}

		// Token: 0x17000031 RID: 49
		// (get) Token: 0x060000FF RID: 255 RVA: 0x00005F6E File Offset: 0x0000416E
		// (set) Token: 0x06000100 RID: 256 RVA: 0x00005F80 File Offset: 0x00004180
		[Category("Appearance")]
		[EditorBrowsable(EditorBrowsableState.Always)]
		[Description("Coordinate system for the HRow and HColumn properties. Can either be 'window' or 'image'.")]
		public string HCoordinateSystem
		{
			get
			{
				return (string)base.GetValue(HMessageDisplayObjectWPF.CoordinateSystemProperty);
			}
			set
			{
				base.SetValue(HMessageDisplayObjectWPF.CoordinateSystemProperty, value);
			}
		}

		// Token: 0x17000032 RID: 50
		// (get) Token: 0x06000101 RID: 257 RVA: 0x00005F8E File Offset: 0x0000418E
		// (set) Token: 0x06000102 RID: 258 RVA: 0x00005FA0 File Offset: 0x000041A0
		[Category("Appearance")]
		[EditorBrowsable(EditorBrowsableState.Always)]
		[Description("Row coordinate of the message. Can either be 'top', 'middle', 'bottom' or a double or an int")]
		public string HRow
		{
			get
			{
				return (string)base.GetValue(HMessageDisplayObjectWPF.RowProperty);
			}
			set
			{
				base.SetValue(HMessageDisplayObjectWPF.RowProperty, value);
			}
		}

		// Token: 0x17000033 RID: 51
		// (get) Token: 0x06000103 RID: 259 RVA: 0x00005FAE File Offset: 0x000041AE
		// (set) Token: 0x06000104 RID: 260 RVA: 0x00005FC0 File Offset: 0x000041C0
		[Category("Appearance")]
		[EditorBrowsable(EditorBrowsableState.Always)]
		[Description("HColumn coordinate of the message. Can either be 'left', 'center', 'right' or a double or an int")]
		public string HColumn
		{
			get
			{
				return (string)base.GetValue(HMessageDisplayObjectWPF.ColProperty);
			}
			set
			{
				base.SetValue(HMessageDisplayObjectWPF.ColProperty, value);
			}
		}

		// Token: 0x17000034 RID: 52
		// (get) Token: 0x06000105 RID: 261 RVA: 0x00005FCE File Offset: 0x000041CE
		// (set) Token: 0x06000106 RID: 262 RVA: 0x00005FE0 File Offset: 0x000041E0
		[Category("Appearance")]
		[EditorBrowsable(EditorBrowsableState.Always)]
		[Description("Color of the text to display in the message.")]
		public string HColor
		{
			get
			{
				return (string)base.GetValue(HMessageDisplayObjectWPF.HColorProperty);
			}
			set
			{
				base.SetValue(HMessageDisplayObjectWPF.HColorProperty, value);
			}
		}

		// Token: 0x06000107 RID: 263 RVA: 0x00005FF0 File Offset: 0x000041F0
		private static void OnPropertyChanged(DependencyObject source, DependencyPropertyChangedEventArgs e)
		{
			HMessageDisplayObjectWPF hmessageDisplayObjectWPF = source as HMessageDisplayObjectWPF;
			if (hmessageDisplayObjectWPF == null)
			{
				return;
			}
			string name = e.Property.Name;
			double d;
			if (!(name == "HRow"))
			{
				if (name == "HColumn")
				{
					if (double.TryParse((string)e.NewValue, out d))
					{
						hmessageDisplayObjectWPF._column = new HTuple(d);
					}
					else
					{
						hmessageDisplayObjectWPF._column = new HTuple((string)e.NewValue);
					}
				}
			}
			else if (double.TryParse((string)e.NewValue, out d))
			{
				hmessageDisplayObjectWPF._row = new HTuple(d);
			}
			else
			{
				hmessageDisplayObjectWPF._row = new HTuple((string)e.NewValue);
			}
			HSmartWindowControlWPF parentHSmartWindowControlWPF = hmessageDisplayObjectWPF.ParentHSmartWindowControlWPF;
			if (parentHSmartWindowControlWPF != null)
			{
				parentHSmartWindowControlWPF.NotifyItemsChanged();
			}
		}

		// Token: 0x06000108 RID: 264 RVA: 0x000060B8 File Offset: 0x000042B8
		public override void Display(HWindow hWindow)
		{
			if (this.HMessageText != null)
			{
				if (this.HFont != null)
				{
					this._tmpFont = hWindow.GetFont();
					hWindow.SetFont(this.HFont);
				}
				hWindow.DispText(new HTuple(this.HMessageText), this.HCoordinateSystem, this._row, this._column, new HTuple(this.HColor), new HTuple(), new HTuple());
				if (this.HFont != null)
				{
					hWindow.SetFont(this._tmpFont);
				}
			}
		}

		// Token: 0x04000078 RID: 120
		public static readonly DependencyProperty HFontProperty = DependencyProperty.Register("HFont", typeof(string), typeof(HMessageDisplayObjectWPF), new PropertyMetadata(null, new PropertyChangedCallback(HMessageDisplayObjectWPF.OnPropertyChanged)));

		// Token: 0x04000079 RID: 121
		public static readonly DependencyProperty MessageTextProperty = DependencyProperty.Register("HMessageText", typeof(string), typeof(HMessageDisplayObjectWPF), new PropertyMetadata(null, new PropertyChangedCallback(HMessageDisplayObjectWPF.OnPropertyChanged)));

		// Token: 0x0400007A RID: 122
		public static readonly DependencyProperty CoordinateSystemProperty = DependencyProperty.Register("HCoordinateSystem", typeof(string), typeof(HMessageDisplayObjectWPF), new PropertyMetadata("window", new PropertyChangedCallback(HMessageDisplayObjectWPF.OnPropertyChanged)));

		// Token: 0x0400007B RID: 123
		private HTuple _row = new HTuple("top");

		// Token: 0x0400007C RID: 124
		public static readonly DependencyProperty RowProperty = DependencyProperty.Register("HRow", typeof(string), typeof(HMessageDisplayObjectWPF), new PropertyMetadata("top", new PropertyChangedCallback(HMessageDisplayObjectWPF.OnPropertyChanged)));

		// Token: 0x0400007D RID: 125
		private HTuple _column = new HTuple("left");

		// Token: 0x0400007E RID: 126
		public static readonly DependencyProperty ColProperty = DependencyProperty.Register("HColumn", typeof(string), typeof(HMessageDisplayObjectWPF), new PropertyMetadata("left", new PropertyChangedCallback(HMessageDisplayObjectWPF.OnPropertyChanged)));

		// Token: 0x0400007F RID: 127
		public static readonly DependencyProperty HColorProperty = DependencyProperty.Register("HColor", typeof(string), typeof(HMessageDisplayObjectWPF), new PropertyMetadata("black"));

		// Token: 0x04000080 RID: 128
		private string _tmpFont;
	}
}
